/* 模板管理页面特有样式 */

/* 页面容器 */
.template-management-container {
  position: relative;
  overflow: hidden;
}

/* 操作按钮区域 */
.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.action-bar .tech-button {
  background: var(--cyber-gradient);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.action-bar .tech-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.action-bar .tech-button:hover::before {
  left: 100%;
}

.action-bar .tech-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 212, 255, 0.5);
}

.action-bar .tech-button i {
  margin-right: 8px;
  font-size: 1.1rem;
}

/* 搜索卡片增强 */
.search-card {
  position: relative;
  overflow: hidden;
}

.search-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--cyber-gradient);
  border-radius: 22px;
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.search-card:hover::before {
  opacity: 0.1;
}

.search-form-tech .el-form-item__label {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
}

.search-form-tech .tech-button {
  background: var(--cyber-gradient);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.search-form-tech .tech-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.search-form-tech .tech-button:hover::before {
  left: 100%;
}

.search-form-tech .tech-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.search-form-tech .tech-button i {
  margin-right: 6px;
}

/* 模板网格 */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* 科技风模板卡片 */
.template-card-tech {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  animation: fadeInUp 0.6s ease-out;
}

.template-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(0, 212, 255, 0.1), transparent);
  animation: rotate-glow 10s linear infinite;
  opacity: 0;
  transition: var(--transition);
}

.template-card-tech:hover .template-glow {
  opacity: 1;
}

.template-card-tech:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 25px 50px rgba(0, 212, 255, 0.2);
}

.template-content {
  position: relative;
  z-index: 2;
  padding: 25px;
}

/* 状态标签 */
.status-badge-tech {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 3;
}

.status-badge-tech.active {
  background: var(--neon-green);
  color: white;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.status-badge-tech.inactive {
  background: rgba(108, 117, 125, 0.8);
  color: white;
  box-shadow: 0 0 15px rgba(108, 117, 125, 0.4);
}

/* 模板信息 */
.template-info {
  margin-bottom: 25px;
}

.template-title {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 15px;
  margin-top: 0;
}

.template-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-item {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.detail-item .label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  min-width: 80px;
}

.detail-item .value {
  color: white;
  font-weight: 600;
}

/* 配置预览 */
.config-preview-tech {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.preview-title {
  color: var(--neon-blue);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-content {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.4;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 操作按钮 */
.template-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.action-btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 对话框头部自定义 */
.dialog-header-tech {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.dialog-header-tech h4 {
  margin: 0;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.expand-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  padding: 8px 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.expand-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.expand-btn:hover::before {
  left: 100%;
}

.expand-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

/* 表单样式 */
.template-form-tech {
  color: white;
}

.template-form-tech .el-form-item__label {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
}

.template-form-tech .tech-button {
  background: var(--cyber-gradient);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.template-form-tech .tech-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.template-form-tech .tech-button:hover::before {
  left: 100%;
}

.template-form-tech .tech-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 212, 255, 0.5);
}

.template-form-tech .tech-button i {
  margin-right: 8px;
}

/* 字段映射容器 */
.field-mapping-container-tech {
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  background: rgba(0, 212, 255, 0.05);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
}

.field-mapping-container-tech::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--cyber-gradient);
  border-radius: 14px;
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.field-mapping-container-tech:hover::before {
  opacity: 0.1;
}

.mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.mapping-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
}

.mapping-title::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 40px;
  height: 1px;
  background: var(--cyber-gradient);
  border-radius: 0.5px;
}

.add-mapping-btn {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--cyber-gradient);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.add-mapping-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.add-mapping-btn:hover::before {
  left: 100%;
}

.add-mapping-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

/* 映射表格 */
.mapping-table-tech {
  background: rgba(177, 205, 205, 0.05);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.delete-mapping-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  border-radius: 6px;
  padding: 4px 8px;
  transition: var(--transition);
}

.delete-mapping-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: scale(1.05);
}

/* 测试区域 */
.test-section {
  color: white;
}

.test-result-section {
  margin-top: 25px;
  position: relative;
}

.result-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  position: relative;
}

.result-title::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--cyber-gradient);
  border-radius: 1px;
}

.test-result-table {
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.test-result-table::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 212, 255, 0.02);
  pointer-events: none;
  z-index: 1;
}

/* 分页样式增强 */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding: 20px 0;
}

.tech-pagination {
  color: white;
}

.tech-pagination .el-pagination__total,
.tech-pagination .el-pagination__jump {
  color: rgba(255, 255, 255, 0.8);
}

.tech-pagination .el-pager li {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 0 4px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tech-pagination .el-pager li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
  transition: var(--transition);
}

.tech-pagination .el-pager li:hover::before {
  left: 100%;
}

.tech-pagination .el-pager li:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--neon-blue);
  color: white;
  transform: translateY(-2px);
}

.tech-pagination .el-pager li.is-active {
  background: var(--cyber-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* 动画延迟 */
.template-card-tech:nth-child(1) {
  animation-delay: 0s;
}

.template-card-tech:nth-child(2) {
  animation-delay: 0.1s;
}

.template-card-tech:nth-child(3) {
  animation-delay: 0.2s;
}

.template-card-tech:nth-child(4) {
  animation-delay: 0.3s;
}

.template-card-tech:nth-child(5) {
  animation-delay: 0.4s;
}

.template-card-tech:nth-child(6) {
  animation-delay: 0.5s;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .template-card-tech {
    margin-bottom: 20px;
  }

  .template-content {
    padding: 20px;
  }

  .template-actions {
    flex-direction: column;
    gap: 8px;
  }

  .action-btn {
    width: 100%;
  }

  .field-mapping-container-tech {
    padding: 15px;
  }

  .mapping-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .action-bar {
    flex-direction: column;
    gap: 10px;
  }

  .action-bar .tech-button {
    width: 100%;
    justify-content: center;
  }

  .search-form-tech .el-row {
    margin: 0;
  }

  .search-form-tech .el-col {
    padding: 0 5px;
    margin-bottom: 15px;
  }

  .pagination-wrapper {
    padding: 15px 0;
  }

  .tech-pagination .el-pager li {
    margin: 0 2px;
  }
}